<template>
  <el-table :data="cartList" style="width: 100%">
    <el-table-column prop="id" label="序号" width="150" />
    <el-table-column prop="name" label="商品" width="200" />
    <el-table-column prop="specification" label="规格" width="120" />
    <el-table-column prop="price" label="单价" width="120" />
    <el-table-column prop="num" label="数量" width="120" />
    <el-table-column prop="sum" label="小计" width="120" />
    <el-table-column label="操作" width="120">
      <template #default>
        <el-button link type="danger" plain size="small" @click="handleClick">删除</el-button>
      </template>
    </el-table-column>
  </el-table>
</template>

<script  setup>
import { ref, reactive } from "vue"
const handleClick = () => {
  console.log('click')
}

const cartList = reactive([
  { id: 1, name: 'xxx', specification: ['big', "small"], price: 200, num: 1, sum: 200 }
])
</script>